#!/bin/bash
# SPDX-License-Identifier: MulanPSL-2.0+
# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.

. $CCI_SRC/container/defconfig.sh

start_etcd_pod

docker_rm etcd-server

cmd=(
	docker run
	-d
	-p 2379:2379
	-p 2380:2380
	-p 4001:4001
	-p 7001:7001
	-v /srv/etcd/dir:/data
	-v /etc/localtime:/etc/localtime:ro
	-e ETCD_UNSUPPORTED_ARCH=arm64
	--name etcd-server
	etcd:alpine
	--name node-1
	--data-dir /data
	--auto-compaction-retention 1
	--max-request-bytes 10485760
	--quota-backend-bytes 8589934592
	--initial-cluster-state new
	--listen-client-urls http://0.0.0.0:2379
	--advertise-client-urls http://0.0.0.0:2379
)

"${cmd[@]}"
